﻿using WeDonekRpc.Client;
using WeDonekRpc.Helper.Config;

namespace AutoTask.Service.Config
{
    internal class TaskConfig
    {
        static TaskConfig ()
        {
            IConfigSection section = RpcClient.Config.GetSection("task");
            section.AddRefreshEvent(_Init);
        }
        private static void _Init ( IConfigSection config, string name )
        {
            IsLimit = config.GetValue<bool>("IsLimit", false);
            RpcMerId = config.GetValue<long[]>("RpcMerId", new long[]
            {
                RpcClient.CurrentSource.RpcMerId
            });
        }
        public static bool IsLimit { get; private set; }
        public static long[] RpcMerId { get; private set; }
    }
}
